package com.hankol.community.adapter

import android.widget.ImageView
import com.baselibrary.extension.checkValue
import com.baselibrary.extension.load
import com.baselibrary.utils.BannerSizeUtil
import com.baselibrary.utils.NumberUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.community.R
import com.hankol.community.bean.ForumClassifyListBean


/**广场--讲坛分类
 *@author:hanke
 *2022/3/30
 *desc:
 */
class SquareForumAdapter : BaseQuickAdapter<ForumClassifyListBean, BaseViewHolder>(R.layout.item_square_forum) {

    override fun convert(helper: BaseViewHolder, item: ForumClassifyListBean) {
        helper.apply {
            setText(R.id.tv_title, item.title)
            setText(R.id.tv_play_num, "${NumberUtils.formatBigNum("${item.allWatchNum}")} 播放")
            getView<ImageView>(R.id.img_cover).load(mContext, item.cover.checkValue())
            BannerSizeUtil.setBannerSizeValue(getView<ImageView>(R.id.img_cover),208,118)
        }
    }
}